# -*- coding: utf-8 -*-
from flask import Blueprint,render_template,request
from common.libs.Helper import osp_render,getCurrentDate
route_member = Blueprint( 'member_page',__name__ )
from common.models.Food import Food
from common.models.Storage import Storage
from common.models.User import User

@route_member.route( "/index" )
def index():
    resq_data = {}
    req = request.values
    query = Food.query
    count = query.count()  # 总共多少条记录
    # 搜索功能实现or_表示定义了一个规则
    list = query.order_by(Food.fid.desc()).all()  # 全量查询，倒叙排列
    resq_data['list'] = list
    resq_data['count'] = count
    return osp_render( "member/index.html" ,resq_data)

@route_member.route( "/info" )
def info():
    return osp_render( "member/info.html" )

@route_member.route( "/set" )
def set():
    return osp_render( "member/set.html" )

@route_member.route( "/comment" )
def comment():
    return osp_render( "member/comment.html" )
